/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tests.clientData;

import java.util.Date;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import clientData.MemberData;
import clientData.MemberDataInt;
import clientData.PostData;
import static org.junit.Assert.*;

/**
 *
 * @author iziko
 */
public class PostDataTest {

    PostData instance;
    MemberData  mem;
    Date ctime;
    Date etime;

    public PostDataTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
         mem = new MemberData(1,"iziko","iz@mail","izik","orgad");
         ctime = new Date();
         etime = new Date();
        instance = new PostData(1,"civic","is great!",ctime,etime,mem) ;
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of getContent method, of class PostData.
     */
    @Test
    public void testGetContent() {
        System.out.println("getContent");
        String expResult = "is great!";
        String result = instance.getContent();
        assertEquals(expResult, result);
    }

    /**
     * Test of getCreationTime method, of class PostData.
     */
    @Test
    public void testGetCreationTime() {
        System.out.println("getCreationTime");
        Date expResult = ctime;
        Date result = instance.getCreationTime();
        assertEquals(expResult, result);
    }

    /**
     * Test of getEditingTime method, of class PostData.
     */
    @Test
    public void testGetEditingTime() {
        System.out.println("getEditingTime");
        Date expResult = etime;
        Date result = instance.getEditingTime();
        assertEquals(expResult, result);
    }

    /**
     * Test of getId method, of class PostData.
     */
    @Test
    public void testGetId() {
        System.out.println("getId");
        int expResult = 1;
        int result = instance.getId();
        assertEquals(expResult, result);
    }

    /**
     * Test of getTitle method, of class PostData.
     */
    @Test
    public void testGetTitle() {
        System.out.println("getTitle");
        String expResult = "civic";
        String result = instance.getTitle();
        assertEquals(expResult, result);
    }

    /**
     * Test of getCreator method, of class PostData.
     */
    @Test
    public void testGetCreator() {
        System.out.println("getCreator");
        MemberDataInt expResult = mem;
        MemberDataInt result = instance.getCreator();
        assertEquals(expResult, result);
    }

    /**
     * Test of toString method, of class PostData.
     */
    @Test
    public void testToString() {
        System.out.println("toString");
        String expResult = "civic";
        String result = instance.toString();
        assertEquals(expResult, result);
    }

}